package com.longteng.lesson2.dubbo;

import com.alibaba.dubbo.config.ApplicationConfig;
import com.alibaba.dubbo.config.ReferenceConfig;
import com.alibaba.dubbo.config.RegistryConfig;
import com.alibaba.dubbo.rpc.service.GenericService;
import com.alibaba.fastjson.JSON;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.HashMap;
import java.util.Map;

public class SpringDubbo {

    @Test
    public void t(){
        ApplicationContext context=new ClassPathXmlApplicationContext("consumerS.xml");
//        DubboTestService dubboTestService =(DubboTestService) context.getBean("dubboTest");
//        String s =dubboTestService.sayHello("你好 dubbo");
//        System.out.println(s);


//        UserService userService =context.getBean("dubboUser",UserService.class);
//        com.longteng.domain.User user=new User();
//        user.setId(1);
//        ResponseMessage responseMessage =userService.getUser(user);
//        System.out.println(JSON.toJSONString(responseMessage));
    }

}
